<?php
use yii\grid\GridView;
use yii\widgets\LinkPager;
?>
<!--图书类-->
<?= GridView::widget([
    'dataProvider' => $dataProvider,
    'columns' => [
        [
            'class' => 'yii\grid\CheckboxColumn',
            'name' => 'id',
        ],
        'res_code',
        'res_title',
        'res_othertitle',
        //'res_volume',
        'classes.title',
        'author',
        //'publisher',
        //'create_date',
        'cl_cat_id',
        //'resource_id',
        'is_self' => [
            'attribute' => 'is_self',
            'value' => function ($model) {
                return $model->is_self == 0 ? '系统分配资源':'自建资源';

            }
        ],
        'created_at',
        //功能
        [
            'class' => 'frontend\modules\common\models\ActionJsColumn',
            'template' => '{update}',
        ]
    ],
    'pager' => [
        'class' => LinkPager::className(),
        'firstPageLabel' => '首页',
        'prevPageLabel' => '《',
        'nextPageLabel' => '》',
        'lastPageLabel' => '尾页',
        //            'goPageLabel' => true,
        //            'totalPageLable' => '共x页',
        //            'goButtonLable' => 'GO',
        'maxButtonCount' => 5,
        'hideOnSinglePage' => false,
    ]
]); ?>